package com.wits.qso.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;

import com.wits.platform.service.BaseService;
import com.wits.platform.web.mvc.PageParam;
import com.wits.qso.dao.CourseMineDao;
import com.wits.qso.entity.Course;
import com.wits.qso.entity.CourseMine;

@Component
public class CourseMineService extends BaseService<Course, String> {
	
	private CourseMineDao courseMineDao;
	
	@Resource
	public void setCourseMineDao(CourseMineDao courseMineDao) {
		this.courseMineDao = courseMineDao;
		this.baseDao=courseMineDao;
	}

	public Page<CourseMine> findCourseMineViewPages(Map<String, Object> params,PageParam page){
		Map<String,Object> param=new HashMap<String,Object>();
		param.putAll(params);
		param.put("orderByArray", new String[]{"course_id"});
		param.put("pageNumber", page.getPageNum()); 
		param.put("pageSize", page.getNumPerPage());
		return courseMineDao.findCourseMineViewPages(param);
	}
}
